package com.cl.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.cl.base.impl.BaseDaoImpl;
import com.cl.bean.Emp;
import com.cl.dao.UserDao;

@Repository
public class UserDaoImpl extends BaseDaoImpl<Emp> implements UserDao {

	@Override
	public Emp findUserUsernameAndPwd(String username, String password) {
		String hql = "FROM Emp WHERE e_loginname = ? AND e_psw = ? ";
		List<Emp> list = (List<Emp>) getHibernateTemplate().find(hql, username,password);
		if(list != null && list.size() > 0){
			return list.get(0);
		}
		return null;
	}

}
